var hello_world = {
  onLoad: function() {
    // initialization code
    this.initialized = true;
    this.strings = document.getElementById("hello_world-strings");
  },

  onMenuItemCommand: function(e) {
    var promptService = Components.classes["@mozilla.org/embedcomp/prompt-service;1"]
                                  .getService(Components.interfaces.nsIPromptService);
    promptService.alert(window, this.strings.getString("helloMessageTitle"),
                                this.strings.getString("helloMessage"));
	/*
	alert("aa " + this + " " + window.document);
	obj = window.document.getElementsByTagName("tabbrowser")[0].selectedBrowser;
	alert(obj.currentURI.spec + " " + obj.contentDocument)
	string = "";
	for(m in obj)
	{
		string += m + " ";
	}
	alert(string);
	*/
  },

  onToolbarButtonCommand: function(e) {
    // just reuse the function above.  you can change this, obviously!
    hello_world.onMenuItemCommand(e);
  }
};

function connectRemote()
{
	try
	{
		url = "http://cnc.appimg.qq.com/happyfarm/data/data_zh_CN_v_173.xml";
		request = Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"]
					  .createInstance(Components.interfaces.nsIXMLHttpRequest);
		request.onload = function(aEvent) {
		  alert("Response Text: " + aEvent.target.responseText);
		};
		request.onerror = function(aEvent) {
		   alert("Error Status: " + aEvent.target.status);
		};
		request.open("GET", url, true);
		request.send(null);
	}
	catch(e)
	{
		alert(e);
	}
}

window.addEventListener("load", function () { hello_world.onLoad();}, false);